using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using SPDevLab.WebParts.JsAppWebPart.Services;

namespace SPDevLab.WebParts.Features.JsAppWebPartSiteInfrastructure
{
    /// <summary>
    /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
    /// </summary>
    /// <remarks>
    /// The GUID attached to this class may be used during packaging and should not be modified.
    /// </remarks>

    [Guid("8dad7d1f-c526-418d-b60b-40cb80cfb7f2")]
    public class JsAppWebPartSiteInfrastructureEventReceiver : SPFeatureReceiver
    {
        #region methods

        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            var site = properties.Feature.Parent as SPSite;

            new DefaultJsAppService().EnsureJsAppSiteInsfastructure(site);
        }

        #endregion
    }
}
